{
  // 抽象类
  abstract class Person {
    name: string;
    constructor(name: string) {
      this.name = name
    }

    abstract run(): void;
  }

  class Student extends Person {
    run() {

    }
  }

  // 接口
  interface Study {
    project: string;
    see(): void;
    eat(food: string): void;
  }

  class Demo extends Person implements Study {
    project: string;
    /**
     *
     */
    constructor(name: string, project: string) {
      super(name)
      this.project = project
    }
    run(): void {
      console.log(this.name)
    }
    see(): void {
      console.log(this.name + '正在看星星')
    }
    eat(food: string): void {
      console.log(this.name + `正在吃${food}...`)
    }
  }
  const d = new Demo('孙小双', '语文')
  d.run()
  d.see()
  d.eat('汉堡')



  interface USB {
    start(): void;
    run(): void;
    end(): void;
  }

  function run(device: USB) {
    device.start()
    device.run()
    device.end()
  }

  class Mouse implements USB {
    start(): void {
      console.log('鼠标插入')
    }
    run(): void {
      console.log('鼠标拖动中...')
    }
    end(): void {
      console.log('鼠标拔下来了')
    }

    
  }

  class Jianpan implements USB {
    start(): void {
      console.log('键盘上来了')
    }
    run(): void {
      console.log('扛着键盘我就来了...')
    }
    end(): void {
      console.log('键盘扔了')
    }

  }

  run(new Jianpan())
  run(new Mouse())


}